<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>节点属性</title>
</head>
<body>
<ul>
    <li title="1">javascript</li>
    <li title="2">HTML/CSS</li>
    <li title="3">jQuery</li>
</ul>
<script type="text/javascript">
    var lists = document.getElementsByTagName("li");
    //document.body.childNodes;
    //document.getElementsByTagName("li");
    for (var i = 0; i < lists.length; i++) {
        //document.write(lists[i].getAttribute("title")+"<br>");
        document.write("第" + i + "个节点的名称" + lists[i].nodeName + "<br>");
        document.write("第" + i + "个节点的值" + lists[i].nodeValue + "<br>");
        document.write("第" + i + "个节点的类型" + lists[i].nodeType + "<br>" + "<br>");
    }
</script>
</body>
</html>